import asyncio


async def faulty_task():
    raise ValueError("Something went wrong!")


async def main():
    try:
        await faulty_task()
    except ValueError as e:
        print(f"Caught an exception: {e}")


asyncio.run(main())